import io.netty.channel.DefaultEventLoopGroup;
import io.netty.util.concurrent.EventExecutor;
import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.TimeUnit;

/**
 * @author zfChen
 * @create 2022/7/5 10:40
 */
@Slf4j
public class StudyNetty {
    public static void main(String[] args) {
        DefaultEventLoopGroup eventExecutors = new DefaultEventLoopGroup(3);
        for (EventExecutor eventLoop:eventExecutors
             ) {
            System.out.println(eventLoop);
        }
        eventExecutors.execute(() -> {
            log.info("普通任务");
        });
        eventExecutors.scheduleAtFixedRate(() -> {
            log.info("running...");
        },0,5, TimeUnit.SECONDS);
    }
}
